-- triple_spell
-- created by xinj
-- 施放X魔法时可额外施放n次

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,
    -- 触发
    trigger = function(who, prop, arg)
        if who.type ~= OBJECT_TYPE_USER then
            return;
        end

        if type(arg) ~= "table" then
            return;
        end
        
        local skillId = arg["skill_id"];
        -- 不是属性指明的技能
        if skillId ~= tonumber(prop[2]) then
            return;
        end

        local target = arg["target"];
        if target == nil then
            return;
        end

        -- 先把触发技能缓存起来
        SkillM.skillTriggerCache(who, skillId, target);
    end,

    record = function(target, prop, path)
        return false;
    end
};
